﻿<s:ScatterViewItem x:Class="eGrid_App.MapFrame" 
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       
                      xmlns:s="http://schemas.microsoft.com/surface/2008"   
                      xmlns:src="clr-namespace:eGrid_App"
                      xmlns:esri="http://schemas.esri.com/arcgis/client/2009"    
                      Background="Transparent" AllowDrop="True" Width="500" Height="500"
                      MinWidth="500" MinHeight="500" RenderTransformOrigin="0.5,0.5" ClipToBounds="True"
                      SizeChanged="ScatterViewItem_SizeChanged"
                      CanMove="True" CanRotate="True" CanScale="True">
    
    <Grid Name="MapGrid">
        
        <!-- Row and column definitions to position content and buttons -->
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="50"/>
        </Grid.ColumnDefinitions>

        <src:ArcGisMap Grid.ColumnSpan="11" Grid.RowSpan="5" x:Name="MainMap" Background="Transparent" CanPan="True" CanZoom="True"   
                       TouchDown="MainMap_TouchDown" TouchMove="MainMap_TouchMove" TouchUp="MainMap_TouchUp" >
        </src:ArcGisMap>

        <!--<Viewbox StretchDirection="Both" Stretch="Fill">
                <InkCanvas x:Name="DrawingPadCanvas" IsHitTestVisible="False" Background="Transparent"/>
            </Viewbox>-->

        <!-- The Map and the ink Canvas (for Annotations Demo)-->
        <!--<Grid Grid.ColumnSpan="11" Grid.RowSpan="5" x:Name="MainMapGrid" ClipToBounds="True" Margin="0.012,0.012,0,0">
            

                                 
        </Grid>-->

        <!-- Glass Picture Frame Effect -->
        <Grid Name="glassFrame1" Background="WhiteSmoke" Opacity="0.5" Grid.ColumnSpan="11" />
        <Grid Name="glassFrame2" Background="WhiteSmoke" Opacity="0.5" Grid.Row="1" Grid.RowSpan="3" />
        <Grid Name="glassFrame3" Background="WhiteSmoke" Opacity="0.5" Grid.ColumnSpan="11" Grid.Row="4" />
        <Grid Name="glassFrame4" Background="WhiteSmoke" Opacity="0.5" Grid.Row="1" Grid.Column="10" Grid.RowSpan="3"/>
        
        <TextBlock Name="MapFrameTitle" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"
                   TextAlignment="Center" FontSize="14" />
                        
        <!--Archive/Close Button-->
        <s:SurfaceButton x:Name="ArchiveButton" Grid.Column="10" Grid.Row="0" Padding="5" Background="White" Width="50" Height="50"
                         Click="ArchiveButton_Click">
            <Image Source="Resources\Buttons\Delete.png"/>
        </s:SurfaceButton>

        <!-- Map layers Button -->
        <s:SurfaceButton x:Name="MapLayersButton" Grid.Row="0" Grid.Column="4" Height="50" Width="50" Padding="5" Background="White"
                         ToolTip="Switch to Google Earth" Click="MapLayersButton_Click">
            <Image Source="Resources\Buttons\Earth.png" />
        </s:SurfaceButton>
        
        <!-- Empty button for future use -->
        <s:SurfaceButton x:Name="Button" Grid.Column="5" Grid.Row="0" Height="50" Width="50" Background="White" />

        <!-- Refresh Map Button -->
        <s:SurfaceButton Name="RefreshMapButton" Grid.Row="0" Grid.Column="6" 
                         Padding="5" Background="White" ToolTip="Refresh" Click="RefreshMapButton_Click">
            <Image Source="Resources\Buttons\Refresh.png" />
        </s:SurfaceButton>
        
        
        <!-- Draw Point Button -->
        <s:SurfaceButton Name="DrawPointButton" Grid.Row="4" Grid.Column="2" 
                         Padding="5" Background="White" ToolTip="Add a point" Click="DrawPointButton_Click">
            <Image Source="Resources\Buttons\ESRI_Stuff\DrawPoint.png" />
        </s:SurfaceButton>

        
        <!-- Draw a Polyline Button -->
        <s:SurfaceButton Name="DrawPolylineButton" Grid.Row="4" Grid.Column="3" 
                         Padding="5" Background="White" ToolTip="Add a Polyline" Click="DrawPolylineButton_Click">
            <Image Source="Resources\Buttons\ESRI_Stuff\DrawPolyline.png" />
        </s:SurfaceButton>

        <!-- Draw a Polygon Button -->
        <s:SurfaceButton Name="DrawPolygonButton" Grid.Row="4" Grid.Column="4" 
                         Padding="5" Background="White" ToolTip="Add a Polygon" Click="DrawPolygonButton_Click">
            <Image Source="Resources\Buttons\ESRI_Stuff\DrawPolygon.png" />
        </s:SurfaceButton>

        <!-- Draw a Rectangle Button -->
        <s:SurfaceButton Name="DrawRectangleButton" Grid.Row="4" Grid.Column="5" 
                         Padding="5" Background="White" ToolTip="Add a Rectangle" Click="DrawRectangleButton_Click">
            <Image Source="Resources\Buttons\ESRI_Stuff\DrawRectangle.png" />
        </s:SurfaceButton>

        <!-- Draw Freehand Button -->
        <s:SurfaceButton Name="DrawFreehandButton" Grid.Row="4" Grid.Column="6"
                         Padding="5" Background="White" ToolTip="Add Freehand" Click="DrawFreehandButton_Click">
            <Image Source="Resources\Buttons\ESRI_Stuff\DrawFreehand.png" />
        </s:SurfaceButton>
        
        <!-- Stop Draw Button -->
        <s:SurfaceButton Name="StopDrawButton" Grid.Row="4" Grid.Column="7" 
                         Padding="5" Background="White" ToolTip="Stop Drawing" Click="StopDrawButton_Click">
            <Image Source="Resources\Buttons\ESRI_Stuff\StopDraw.png" />
        </s:SurfaceButton>

        <!-- Clear Graphics Button -->
        <s:SurfaceButton Name="ClearGraphicsButton" Grid.Row="4" Grid.Column="8" 
                         Padding="5" Background="White" ToolTip="Clear Graphics" Click="ClearGraphicsButton_Click">
            <Image Source="Resources\Buttons\ESRI_Stuff\ClearGraphics.png"/>
        </s:SurfaceButton>
        
 
        <!-- Annotations Demo Version -->
        <!--<Ellipse Name="CurrentColor" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                 Grid.Row="4" Grid.Column="7" Fill="Black" ToolTip="Choose Color" TouchDown="CurrentColor_TouchDown"/>-->
        
        <!-- Color Wheel -->
        <!--<Image Name="ColorWheel" Grid.Row="2" Grid.Column="5" Source="Resources\Buttons\ColorWheel.png" 
               RenderTransformOrigin="0.5, 0.5" Visibility="Hidden" TouchDown="ColorWheel_TouchDown">            
            <Image.RenderTransform>
                <ScaleTransform ScaleX="4" ScaleY="4" />
            </Image.RenderTransform>
        </Image>-->
        
    </Grid>

</s:ScatterViewItem>